package com.cius.eshop.controller;

import com.cius.eshop.bean.Cate;
import com.cius.eshop.service.CateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * Created by ciuscheung on 17/7/12.
 */

@Controller
@RequestMapping("cate")
public class CateController {

    @Autowired
    CateService cateService;

    @RequestMapping("getCates")
    public String getCates(Model model){
        List<Cate> cateList = cateService.findCatesTree();
        model.addAttribute("cateList",cateList);
        return "navigation";
    }
}
